package Dao.impl;/*
 *徐韬
 *2021/9/20
 *13:07
 */

import Dao.empManagerDao;
import Util.DruidUitl;
import entity.empManager;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class empManagerDaoimpl implements empManagerDao {
    QueryRunner queryRunner = new QueryRunner();
    @Override
    public empManager select(String userName) {
        empManager empManager = null;
        try {
            return queryRunner.query(DruidUitl.getConnection(),"select * from empManager where userName = ?",new BeanHandler<>(empManager.class),userName);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage()+"在查询用户名时出现异常");
        }
    }
}
